<template>
  <div id="app">
    <div class="header">
      <!-- <span>1级页面</span> -->
      <router-link to="/home/123">首页</router-link> |
      <router-link :to="{name:'/about', params: {user: username}}">关于</router-link> |
      <span class="to-mine" @click="tomine">我的</span> |
      <router-link to="/detail">详情</router-link> 

    </div>

    <!-- 路由路口 -->
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: "App",
  data() {
    return {
      username: '启明'
    };
  },
  methods: {
    tomine() {
      // 编程式路由跳转
      this.$router.push({name: 'wn', params:{num:1}}) 
    },
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
